/**
 * localStorage操作
 * @param {*}
 * @param {*}
 */
export const setStore = (key, content) => {
  if (!key) return
  if (typeof content !== 'string') {
    content = JSON.stringify(content)
  }
  window.localStorage.setItem(key, content)
}

/**
 * 根据key获取localStorage
 * @param {*}
 */
export const getStore = key => {
  if (!key) return
  return JSON.parse(window.localStorage.getItem(key))
}

/**
 * 删除localStorage
 * @param {*}
 */
export const removeStore = key => {
  if (!key) return
  return window.localStorage.removeItem(key)
}
